feat(features): support scoped 'features disable' - #246
Merged
Conversation
Add --project/--gitlab-group/--github-org/--exclude flags to 'gitte features disable', mirroring 'enable'. A scoped disable removes only the matching projects from a gate's current scope, leaving it enabled for the rest, and disables the gate entirely once the last project is removed. Extract buildOverrideFromFlags (shared with enable) and add features.ProjectsInGateScope to resolve a gate's configured project set.
jakobkollerup
left a comment
There was a problem hiding this comment.
Nice feature — clean refactor of the flag parsing, good docs, and the symmetric enable/disable UX makes sense. I left inline comments; the one on CheckedStateToOverride is the one I'd hold merge on, since a scoped disable can quietly broaden the gate's effective scope (confirmed with a repro test).
Two things that don't fit an inline anchor:
features/tui.goenterScopeTreenow duplicatesProjectsInGateScopeverbatim — it could call the new helper.- Minor behavior change: a state entry with
Enabled: false(hand-edited state file) now prints "was not enabled" and is left in place, where the old code deleted it. Harmless, just noting it.
Address review on scoped 'features disable': - runtime: intersect OverrideScope with the gate's config scope in extraEnvForProject so an override can only narrow, never broaden, the effective scope (also fixes the pre-existing TUI scope-editor flaw). - disable: unscoped path now cleans up a state entry for a gate removed from config instead of erroring; scoped path still requires config. - enable/disable: error when --exclude is given without --gitlab-group/--github-org. - tui: enterScopeTree reuses features.ProjectsInGateScope. - test: regression test that an override cannot broaden the config scope.
LauJosefsen
force-pushed
the
lejo/features-disable-scoped
branch
from
July 13, 2026 09:37
0ea0a6e to
5651f05
Compare
Collaborator
Author
|
Thanks @jakobkollerup — all addressed in the latest push.
|
jakobkollerup
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--project,--gitlab-group,--github-org, and--excludeflags togitte features disable, mirroring the flags already ongitte features enable.Previously
disablecould only turn a gate off entirely. A scoped disable now removes only the matching projects from the gate's current scope, leaving it enabled for the rest — and disables the gate entirely once the last project is removed. This makes per-project enable/disable symmetric:Changes
cmd/features.go:disablegains the scope flags; no flags = disable entirely (unchanged behaviour). ExtractedbuildOverrideFromFlags(shared withenable).features/scope.go: new exportedProjectsInGateScope(cfg, gate)to resolve the set of projects a gate's configured scope applies to (reuses existing scope helpers to recompute the override after removal).docs/commands.md,docs/config.md: document scopeddisable.features/scope_test.go: tests forProjectsInGateScope.Behaviour
Verified against a fixture workspace:
disable <gate> --project Xon a full-scope gatedisable <gate> --project <last>disable <gate> --project Xwhen gate offdisable <gate> --project <unknown/out-of-scope>go build ./...,go vet ./..., andgo test ./...all pass.